<?php
namespace Home\Controller;

class AreaController extends CommonController {

    public function area(){     //获取数据库的员工所在区域信息
    
        //echo $post;
        //return  false;
        /* $data['area'] = ''
         $this->ajaxReturn($data); */
        //$data =array(array('area'=>'北京','count'=>13),array('area'=>'南京','count'=>23),array('area'=>'上海','count'=>16),array('area'=>'安徽','count'=>33)) ;
       $staff = D('staff');
       $data = $staff->field('count(area) as count,area')->group('area')->select();
        
       $this->ajaxReturn($data);
    }
    
    public function areaSelect(){   //各地省份数据源
       $area = array(
           array('area'=>'北京','name'=>'北京'),array('area'=>'天津','name'=>'天津'),array('area'=>'河北','name'=>'河北'),
           array('area'=>'山西','name'=>'山西'),array('area'=>'内蒙古','name'=>'内蒙古'),array('area'=>'辽宁','name'=>'辽宁'),
           array('area'=>'吉林','name'=>'吉林'),array('area'=>'黑龙江','name'=>'黑龙江'),array('area'=>'上海','name'=>'上海'),
           array('area'=>'江苏','name'=>'江苏'),array('area'=>'浙江','name'=>'浙江'),array('area'=>'安徽','name'=>'安徽'),
           array('area'=>'福建','name'=>'福建'),array('area'=>'江西','name'=>'江西'),array('area'=>'山东','name'=>'山东'),
           array('area'=>'河南','name'=>'河南'),array('area'=>'湖北','name'=>'湖北'),array('area'=>'湖南','name'=>'湖南'),
           array('area'=>'广东','name'=>'广东'),array('area'=>'广西','name'=>'广西'),array('area'=>'海南','name'=>'海南'),
           array('area'=>'重庆','name'=>'重庆'),array('area'=>'四川','name'=>'四川'),array('area'=>'贵州','name'=>'贵州'),
           array('area'=>'云南','name'=>'云南'),array('area'=>'西藏','name'=>'西藏'),array('area'=>'陕西','name'=>'陕西'),
           array('area'=>'甘肃','name'=>'甘肃'),array('area'=>'青海','name'=>'青海'),array('area'=>'宁夏','name'=>'宁夏'),array('area'=>'新疆','name'=>'新疆')
       ); 
      $this->ajaxReturn($area);
    }
}
